/*
 #####   ##   #####  #    #   ##   #    #
   #    #  #  #    # ##  ##  #  #  ##   #
   #   #    # #####  # ## # #    # # #  #
   #   ###### #    # #    # ###### #  # #
   #   #    # #    # #    # #    # #   ##
   #   #    # #####  #    # #    # #    #
*/

.tabman {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    background-color: var(--color-titlebar);
    cursor: default;
    font-size: var(--px-font);
    height: 33px;
    border-bottom: 1px solid var(--color-border);
}

/*
 #####   ##   #####   ####
   #    #  #  #    # #
   #   #    # #####   ####
   #   ###### #    #      #
   #   #    # #    # #    #
   #   #    # #####   ####
*/

.tabman-tabs {
    max-width: calc(100% - 256px);
    float: left;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    margin: -1px;
    padding: 1px;
    -webkit-app-region: no-drag;
}

body.system-titlebar .tabman-tabs {
    max-width: calc(100% - 95px);
}

/*
 #####  #    # ##### #####  ####  #    #  ####
 #    # #    #   #     #   #    # ##   # #
 #####  #    #   #     #   #    # # #  #  ####
 #    # #    #   #     #   #    # #  # #      #
 #    # #    #   #     #   #    # #   ## #    #
 #####   ####    #     #    ####  #    #  ####
*/

.tabman-buttons {
    float: left;
    height: 32px;
}

.tabman-buttons button {
    -webkit-app-region: no-drag;
    outline: none;
    float: left;
    color: var(--color-top);
    background: none;
    border: 1px solid transparent;
    margin: -1px;
    font-size: var(--px-font);
    padding: 10px;
    height: 34px;
}

.tabman-buttons button img {
    vertical-align: top;
}

.tabman-buttons button:hover {
    background-color: var(--color-second);
    border-color: var(--color-border) !important;
}

.tabman-buttons button:focus {
    box-shadow: var(--shadow-focus);
    border-color: var(--color-border) !important;
}

.tabman-buttons button:active {
    background-color: var(--color-border);
}

/*
 #####   ##   #####
   #    #  #  #    #
   #   #    # #####
   #   ###### #    #
   #   #    # #    #
   #   #    # #####
*/

.tabman-tab {
    position: relative;
    color: var(--color-top);
    height: 34px;
    padding: 8px;
    cursor: default;
    width: 256px;
    min-width: 34px;
    flex-grow: 1;
    border: 1px solid var(--color-border);
    margin: -1px;
    margin-right: 0;
    margin-bottom: 0;
    text-align: left;
    background-color: var(--color-titlebar);
    outline: none;
    transition: opacity 0.25s, transform 0.25s;
}

.tabman-tab.invisible {
    display: none;
}

.tabman-tab.active {
    background-color: var(--color-back);
    border-bottom: 1px solid var(--color-back);
}

.tabman-tab:active {
    background-color: var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.tabman-tab.gu-mirror {
    border-bottom: 1px solid var(--color-border);
    opacity: 1;
    box-shadow: 0 0 4px rgba(0, 0, 0, var(--opacity-over));
}

.tabman-tab:focus {
    box-shadow: var(--shadow-focus);
    border-bottom: 1px solid var(--color-border);
}

/*
 #####   ##   #####     #  ####   ####  #    #
   #    #  #  #    #    # #    # #    # ##   #
   #   #    # #####     # #      #    # # #  #
   #   ###### #    #    # #      #    # #  # #
   #   #    # #    #    # #    # #    # #   ##
   #   #    # #####     #  ####   ####  #    #
*/

.tabman-tab-icon {
    display: inline-block;
    height: 16px;
}

.tabman-tab-icon img {
    max-width: 16px;
    max-height: 16px;
}

.tabman-tab.active .tabman-tab-icon {
    opacity: 1;
}

/*
 #####   ##   #####     ##### # ##### #      ######
   #    #  #  #    #      #   #   #   #      #
   #   #    # #####       #   #   #   #      #####
   #   ###### #    #      #   #   #   #      #
   #   #    # #    #      #   #   #   #      #
   #   #    # #####       #   #   #   ###### ######
*/

.tabman-tab-title {
    overflow: hidden;
    position: absolute;
    top: 6px;
    left: 32px;
    right: 28px;
    white-space: nowrap;
    word-break: keep-all;
    text-overflow: ellipsis;
}

.tabman-tab.active .tabman-tab-title {
    opacity: 1
}

/*
 #####   ##   #####     #####  #    # ##### #####  ####  #    #  ####
   #    #  #  #    #    #    # #    #   #     #   #    # ##   # #
   #   #    # #####     #####  #    #   #     #   #    # # #  #  ####
   #   ###### #    #    #    # #    #   #     #   #    # #  # #      #
   #   #    # #    #    #    # #    #   #     #   #    # #   ## #    #
   #   #    # #####     #####   ####    #     #    ####  #    #  ####
*/

.tabman-tab:hover .tabman-tab-buttons button, .tabman-tab.active .tabman-tab-buttons button {
    transform: scale(1);
}
  
.tabman-tab-buttons {
    position: absolute;
    right: 5px;
    top: 5px;
}
  
.tabman-tab-buttons button {
    outline: none;
    display: inline-block;
    color: var(--color-top);
    background: none;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: var(--px-radius);
    position: relative;
    border: 1px solid transparent;
    transition: transform 0.25s;
    transform: scale(0);
}
  
.tabman-tab-buttons button:after {
    content: '';
    height: 12px;
    border-left: 2px solid var(--color-top);
    position: absolute;
    transform: rotate(45deg);
    left: 9px;
    top: 4px;
}
  
.tabman-tab-buttons button:before {
    content: '';
    height: 12px;
    border-left: 2px solid var(--color-top);
    position: absolute;
    transform: rotate(-45deg);
    top: 4px;
    left: 9px;
}
  
.tabman-tab-buttons button:hover {
    background-color: var(--color-second);
    border-color: var(--color-border);
}
  
.tabman-tab-buttons button:focus {
    box-shadow: var(--shadow-focus);
    transform: scale(1);
}
  
.tabman-tab-buttons button:active {
    background-color: var(--color-border);
}

/*
 #####   ##   #####     #####  #####  ###### #    # # ###### #    #
   #    #  #  #    #    #    # #    # #      #    # # #      #    #
   #   #    # #####     #    # #    # #####  #    # # #####  #    #
   #   ###### #    #    #####  #####  #      #    # # #      # ## #
   #   #    # #    #    #      #   #  #       #  #  # #      ##  ##
   #   #    # #####     #      #    # ######   ##   # ###### #    #
*/

#tab-preview {
    z-index: 1000;
    position: absolute;
    display: none;
    left: 0;
    width: 248px;
    top: 37px;
    height: 32px;
    background-color: var(--color-element);
    text-align: center;
    border: 1px solid var(--color-border);
    animation: append-center;
    animation-duration: 0.25s;
    text-align: left;
    border-radius: var(--px-radius);
    box-shadow: 0 0 4px rgba(0, 0, 0, var(--opacity-over));
}

#tab-preview.show {
    display: inline-block;
}

#tab-preview-title, #tab-preview-url {
    overflow: hidden;
    position: absolute;
    left: 4px;
    right: 4px;
    white-space: nowrap;
    word-break: keep-all;
    text-overflow: ellipsis;
    font-size: 10px;
}

#tab-preview-title {
    top: 1px;
}

#tab-preview-url {
    top: 14px;
    opacity: var(--opacity-over);
}

/*
 ##### #    # ######    ###### #    # #####
   #   #    # #         #      ##   # #    #
   #   ###### #####     #####  # #  # #    #
   #   #    # #         #      #  # # #    #
   #   #    # #         #      #   ## #    #
   #   #    # ######    ###### #    # #####
*/